using System;
using System.Drawing;
using System.Drawing.Imaging;

/// <summary>
/// Class to develop screenshots
/// </summary>
class Screenshot
{
	private Screenshot() {}
	
	/// <summary>
	/// Captures screen by given dimensions
	/// </summary>
	/// <param name="SourcePoint">Start from</param>
	/// <param name="DestinationPoint">Destination point</param>
	/// <param name="SelectionRectangle">Rectangle used to capture</param>
	/// <param name="FilePath">File path to store captured image</param>
	public static void CaptureImage(Point SourcePoint, Point DestinationPoint, 
	                                Rectangle SelectionRectangle, string FilePath)
	{
    	using (Bitmap bitmap = new Bitmap(SelectionRectangle.Width, SelectionRectangle.Height))
    	{
            using (Graphics g = Graphics.FromImage(bitmap))
            {
            	g.CopyFromScreen(SourcePoint, DestinationPoint, SelectionRectangle.Size);
            }
            bitmap.Save(FilePath, ImageFormat.Jpeg);
		// comment
        }
    }
}
